public class Factors {

	private Operands opr;
	private Factors factor;

	public Factors(Tokens tokens){
		this.opr = null;
		this.factor = null;
		this.parse(tokens);
	}

	public void parse(Tokens tokens) {
		this.opr = new Operands(tokens);
		// check for '*'
		if(tokens.getToken() == 24){
			tokens.skipToken();
			this.factor = new Factors(tokens);
		}
	}
	

	public int runFac(){
		int value = this.opr.runOp();
		// if there is a factor to be multiplied.
		if(this.factor != null){
			value = value * this.factor.runFac();
		}
		return value;
	}	
}